export function get(path: string, params?: any) {
  const queryString = new URLSearchParams(params).toString();
  const baseUrl = process.env.BASE_URL;
  const url = `${baseUrl}${path}?${queryString}`;
  return fetch(url);
}

export function post(path: string, params: any) {
  const baseUrl = process.env.BASE_URL;
  const url = `${baseUrl}${path}`;
  const options = {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify(params),
  };
  return fetch(url, options);
}
